//package com.cheng.example.geektime.designpatterns.j60.v2;
//
//import java.io.FileInputStream;
//import java.util.Properties;
//
//// 运行时动态确定，根据配置文件的配置决定使用哪种策略
//public class Application {
//    public static void main(String[] args) throws Exception {
//        EvictionStrategy evictionStrategy = null;
//        Properties props = new Properties();
//        props.load(new FileInputStream("./config.properties"));
//
//        String type = props.getProperty("eviction_type");
//        evictionStrategy = EvictionStrategyFactory.getEvictionStrategy(type);
//        UserCache userCache = new UserCache(evictionStrategy);
//        //...
//    }
//}
//
//// 非运行时动态确定，在代码中指定使用哪种策略
////public class Application {
////    public static void main(String[] args) {
////        //...
////        EvictionStrategy evictionStrategy = new LruEvictionStrategy();
////        UserCache userCache = new UserCache(evictionStrategy);
////        //...
////    }
////}